package com.xxx.pojo.bean;

import lombok.Data;

import java.math.BigDecimal;

@Data
public class IdName implements Comparable<IdName> {

    private String id;
    private String name;
    private String isOptional = "0";
    private String isDefault = "0";
    private BigDecimal prDec = BigDecimal.ZERO;


    @Override
    public int compareTo(IdName o) {
        // 按收益率倒序
        if(this.prDec.compareTo(o.prDec) > 0) {
            return -1;
        } else if(this.prDec.compareTo(o.prDec) < 0) {
            return  1;
        }
        return 0;
    }
}
